import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { Pages } from './pages.component';

import { PagesGuard } from './pages-guard.service';

// noinspection TypeScriptValidateTypes
const routes: Routes = [
  {
    path: 'pages',
    component: Pages,
    canActivateChild: [PagesGuard],
    children: [
      {
        path: 'user',
        loadChildren: 'app/pages/user/user.module#UserModule'
      },
      {
        path: 'company',
        loadChildren: 'app/pages/company/company.module#CompanyModule'
      },
      {
        path: 'asso',
        loadChildren: 'app/pages/association/association.module#AssociationModule'
      },
    ]
  },
];


@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class PagesRoutingModule { }
